Startup Examples
Here are some demo programs for both 2D OpenGL and User Interface code in Java:
- FrameTester.java This program has a spiining triangle and a control panel with Quit, Pause and Resume buttons.
- SimpleGui.java This focuses more on the user controls -- there is a Quit button, a pair of sliders for controlling location, and a set of radio buttons for selecting the color of a small square on the canvas.
- SimpleGuiWithRotation.java This works like SimpleGui only the square rotates, to give another example of animation.
- SimpleGuiNoReshape.java This shows what happens if you omit the reshape( ) method -- the program still runs but distorts the output.
- SimpleNoGui.java This omits all of the user controls, so it makes a simple program that just focuses on the OpenGL commands.
- TwoFrameTester.java This works like FrameTester.java, only the control panel and the canvas are in separate, unattached, windows.
- MultipleFrameTester.java This uses the object-orientedness of the system to pop up multiple, independently-running copies of FrameTester.java. Why? Just to show we can do it.